  //-----------------
  // un-tweaks
  //-----------------
   matrix WorldVP:WorldViewProjection; 
   matrix World:World;    

  //-----------------
  // tweaks
  //-----------------
   float4 Color = {1.0f, 0.0f, 0.0f, 1.0f};
   float U = 1.0f; 
   float V = 1.0f; 
	
  //-----------------
  // Textures
  //-----------------
   texture BaseTX
    <
	string Name="";
    >;	
   sampler2D Base = sampler_state 
    {
 	texture = <BaseTX>;
	MagFilter = None;
	MinFilter = None;
	MipFilter = None;
	AddressU = Wrap;
	AddressV = Wrap;
	AddressW = Wrap;	
    };

  //-----------------
  // structs 
  //-----------------
   struct input
     {
 	float4 Pos:POSITION; 
 	float2 UV:TEXCOORD; 
	float3 Normal : NORMAL;
     };
   struct output
     {
	float4 OPos:POSITION; 
 	float2 Tex:TEXCOORD0;
     };

  //-----------------
  // vertex shader
  //-----------------
   output VS(input IN) 
     {
 	output OUT;
	OUT.OPos=mul(IN.Pos,WorldVP); 
 	OUT.Tex=IN.UV*float2(U,V);
	float3 Wnor=mul(IN.Normal,World); Wnor=normalize(Wnor);
	float3 WPos=mul(IN.Pos,World);
	return OUT;
     }

  //-----------------
  // pixel shader
  //-----------------
    float4 PS(output IN)  : COLOR
     {
	float4 Texture=tex2D(Base,IN.Tex); 
	float4 Light=Color;
	return Texture*Light;
     }

  //-----------------
  // techniques   
  //-----------------
   technique Lighting
      {
 	pass p1
      {	
	ZEnable = true;
	ZWriteEnable = true;	
 	vertexShader = compile vs_1_1 VS(); 
 	pixelShader  = compile ps_1_4 PS(); 	
      }
      }
